#include <iostream>
using namespace std;
void solve()
{
        int n,m;
        cin >> n >> m;
        if(n == 0)
        {
           if(m % 2 == 0)
            {
                cout << "Yes" << endl;
                return;
            }
            cout << "No" << endl;
            return;
        }
        else 
        {
            if(m % 2 == 1)
            {
                cout << "Yes" << endl;
                return;
            }
            cout << "No" << endl;
            return;
        }
}
signed main()
{
    int t;
    cin >> t;
    while(t--)
    {
        solve();
    }
    return 0;
}